{% extends 'base.html' %}
{% load staticfiles %}
<link rel="stylesheet" href="{% static 'base.css' %}">

{% block title %}
    {{ blog.title }}
{% endblock %}

{% block nav_blog_active %}active{% endblock %}

{% block content %}
    <div class="container">
        <div class="row">
            <div class="col-xs-10 col-xs-offset-1">
                <h3>{{ blog.title }}</h3>
                <ul class="blog-info-description">
                    <li>作者:{{ blog.author }}</li>
                    <li>发布时间:{{ blog.created_time| date:"Y-m-d H:n:s" }}</li>
                    <li>分类:<a href="{% url 'blog_with_type' blog.blog_type.pk %}">{{ blog.blog_type }}</a></li>
                </ul>
                <div class="blog-content">{{ blog.content|safe }}</div>{# safe过滤器,过滤掉html代码 #}
                {# 前后翻页效果 #}
                <div class="blog-more">
                    <p>
                        {% if previous_blog %}
                            <a href="{% url 'blog_detail' previous_blog.pk %}">上一篇:{{ previous_blog.title }}</a>
                        {% endif %}
                    </p>
                    <p>
                        {% if next_blog %}
                            <a href="{% url 'blog_detail' next_blog.pk %}">下一篇:{{ next_blog.title }}</a>
                        {% endif %}
                    </p>
                </div>
            </div>
        </div>
    </div>



{% endblock %}


